//
//  ClientTool.h
//  Demo
//
//  Created by 龚碧容 on 2017/9/15.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import <Foundation/Foundation.h>

//#define kBaseURL @"http://116.211.121.99:7777" //@"http://116.211.121.56" //生产环境地址

#define kBaseURL @"http://116.211.121.56"
#define kBaseImageUrl @"http://116.211.121.40" //生产环境地址  //@"http://172.16.0.70:7001"

#define kWebShareUrl @"http://text.sevalo.com:8080"

@interface ClientTool : NSObject

+(void)alertLoginWithVC;

/////formData 提交
+ (void)postUrlPathAndFormData:(NSString *)urlPath withParamers:(NSMutableDictionary *)parameters andBody:(NSDictionary *)body success:(void (^)(id responseObject))success failure:(void (^)( NSError *error))failure;

+ (void)postUrlPath:(NSString *)urlPath withParamers:(NSMutableDictionary *)tokenDic type:(NSMutableArray *)headerImageArray success:(void (^)(id responseObject))success failure:(void (^)( NSError *error))failure;
/*
 Get方法请求数据
 @param urlPath 路径
 @param parameters 请求需要的参数,只传原始参数
 @param body 上传的body
 @param success 成功block
 @param failure 失败block
 @return
 */
+ (void)getUrlPath:(NSString *)urlPath withParamers:(NSDictionary *)parameters  andBody:(NSDictionary *)body success:(void (^)(id responseObject))success failure:(void (^)( NSError *error))failure;

/*
 Post方法请求数据
 @param urlPath 路径
 @param parameters 请求需要的参数,只传原始参数
 @param body 上传的body
 @param success 成功block
 @param failure 失败block
 @return
 */
+ (void)postUrlPath:(NSString *)urlPath withParamers:(NSDictionary *)parameters andBody:(NSDictionary *)body success:(void (^)(id responseObject))success failure:(void (^)( NSError *error))failure;

/*
 上传文件功能
 @param urlPath 路径
 @param parameters 请求需要的参数,只传原始参数
 @param body 上传的body
 @param progress 进度block
 @param success 成功block
 @param failure 失败block
 @return
 */
+ (void)uploadfileWithUrlPath:(NSString *)urlPath
                 withParamers:(NSDictionary *)parameters
                      andBody:(NSDictionary *)body
                     progress:(void (^)(NSProgress *uploadProgress))progress
                      success:(void (^)(id responseObject))success
                      failure:(void (^)( NSError *error))failure;


/**
 *  下载文件功能
 *
 *  @param URLString                 要下载文件的URL
 *  @param downloadFileProgress      下载的进度条，百分比
 *  @param setupFilePath             设置下载的路径
 *  @param downloadCompletionHandler 下载完成后（下载完成后可拿到存储的路径）
 */
+ (void)createUnloginedDownloadFileWithURLString:(NSString *)URLString
                            downloadFileProgress:(void(^)(NSProgress *downloadProgress))downloadFileProgress
                                   setupFilePath:(NSURL*(^)(NSURLResponse *response))setupFilePath
                       downloadCompletionHandler:(void (^)(NSURL *filePath, NSError *error))downloadCompletionHandler;

+ (void)aFNetworkStatus;

//验证手机号是否有效
+ (BOOL)isMobileValid:(NSString *)mobile;
+ (BOOL)judgePassWordLegal:(NSString *)pass;
//MD5加密
+ (NSString *)md5:(NSString *)input;
//判断字符串是否为空
+(BOOL)isNull:(id)object;
//隐藏navgation下的横线
+ (UIImageView *)findHairlineImageViewUnder:(UIView *)view;

//跳转到登录界面
//+ (void)pushToLoginVC;

@end
